package com.p2p.front.dal.model;

import java.io.Serializable;
import java.util.Date;

import com.p2p.base.model.Money;

/**
 * @author ruiqi
 *
 */
public class TenderReturn implements Serializable {

	private static final long serialVersionUID = -1964423819099231765L;
	
	public enum ReturnType{
		
		/**
		 * 正常还款
		 */
		NORMAL(0),
		
		/**
		 * 逾期还款
		 */
		OVERDUE(1),
		
		/**
		 * 提前还款
		 */
		ADVANCE(2),
		
		/**
		 * 债权转让
		 */
		TRANSFER(3),
		;
		private int code;
		
		public int getCode() {
			return code;
		}

		private ReturnType(int code) {
			this.code=code;
		}
	}

	private Long id;// 回收ID
	private Long tid;// 投标ID
	private Integer no;// 第几期
	private Long uid;// 用户ID
	private Long lid;// 贷款ID
	private Money principal = new Money();// 本金
	private Money amount = new Money();// 总额
	private Date startTime;
	private Date time;// 还款时间
	private Integer status;// 状态: 21-回收中,31-已回收
	private Integer isFlow;// 是否流转标投注
	private Integer returnType;//回款类型：0-正常回款，1-逾期回款，2-提前回款
	private Money extraInterest = new Money(0,0);//回款产生的额外利息，如逾期回款和提前回款
	private Date updateTime;//更新时间
	
	private Long loanUid;
	private Long loanBeginTime;
	private Money loanAmount;
	private Double loanApr;
	private Long loanLno;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getTid() {
		return tid;
	}

	public void setTid(Long tid) {
		this.tid = tid;
	}

	public Integer getNo() {
		return no;
	}

	public void setNo(Integer no) {
		this.no = no;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Long getLid() {
		return lid;
	}

	public void setLid(Long lid) {
		this.lid = lid;
	}

	public Money getPrincipal() {
		return principal;
	}

	public void setPrincipal(Money principal) {
		this.principal = principal;
	}

	public Money getAmount() {
		return amount;
	}

	public void setAmount(Money amount) {
		this.amount = amount;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getIsFlow() {
		return isFlow;
	}

	public void setIsFlow(Integer isFlow) {
		this.isFlow = isFlow;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getLoanUid() {
		return loanUid;
	}

	public void setLoanUid(Long loanUid) {
		this.loanUid = loanUid;
	}

	public Long getLoanBeginTime() {
		return loanBeginTime;
	}

	public void setLoanBeginTime(Long loanBeginTime) {
		this.loanBeginTime = loanBeginTime;
	}

	public Money getLoanAmount() {
		return loanAmount;
	}

	public void setLoanAmount(Money loanAmount) {
		this.loanAmount = loanAmount;
	}

	public Double getLoanApr() {
		return loanApr;
	}

	public void setLoanApr(Double loanApr) {
		this.loanApr = loanApr;
	}

	public Long getLoanLno() {
		return loanLno;
	}

	public void setLoanLno(Long loanLno) {
		this.loanLno = loanLno;
	}

	public Integer getReturnType() {
		return returnType;
	}

	public void setReturnType(Integer returnType) {
		this.returnType = returnType;
	}

	public Money getExtraInterest() {
		return extraInterest;
	}

	public void setExtraInterest(Money extraInterest) {
		this.extraInterest = extraInterest;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public void caluReturnAmount(){
		
	}
	@Override
	public String toString() {
		return "TenderReturn [id=" + id + ", tid=" + tid + ", no=" + no
				+ ", uid=" + uid + ", lid=" + lid + ", principal=" + principal
				+ ", amount=" + amount + ", time=" + time + ", status="
				+ status + ", isFlow=" + isFlow + ", loanUid=" + loanUid
				+ ", loanBeginTime=" + loanBeginTime + ", loanAmount="
				+ loanAmount + ", loanApr=" + loanApr + ", loanLno=" + loanLno
				+ "]";
	}

}
